-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Extend options stdlib #24849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Extend options stdlib #24849
Conversation
eca83a3
to
ee24d96
Compare
The failure being reported in CI is:
I may be missing something, but that seems unrelated to the change in this PR |
Correct, don't worry. |
for results, I've been planning to reuse tricks like https://github.com/nim-lang/Nim/blob/version-2-2/lib/pure/collections/sequtils.nim#L97 to avoid most of the extra copies that are unnecessary - this implementation is very heavy on copies in general, often in a way that is tricky for the compiler to get rid of. a second trick to use is to verify that the code efficiently moves data around and/or uses cursors where applicable, ie in |
In particular, see https://github.com/arnetheduck/nim-results/blob/df8113dda4c2d74d460a8fa98252b0b771bf1f27/results.nim#L1430 for a much more efficient way to inject a variable into a template - there is also a variation on the same theme when genericsopensym is not enabled. |
This changes adds more procs to the
options
stdlib. These are convenience functions that make life easier when interacting with Options -- I've wound up adding them to just about every app I have written with Nim.